import router from '@/router'
export default {
  inserted(el, binding, vnode) {
    const { value } = binding
    if (typeof value !== 'boolean') {
      const actions = router.currentRoute.meta.actions
      if (!(!!actions && actions instanceof Array && actions.includes(value))) {
        el.parentNode && el.parentNode.removeChild(el)
      }
    } else {
      if (!value) {
        el.parentNode && el.parentNode.removeChild(el)
      }
    }
  }
}
